import os
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
from transformers import AutoModel, AutoTokenizer

model_name = "BAAI/bge-m3"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

# 保存模型到本地目录
save_dir = "model/bge-m3-1"
tokenizer.save_pretrained(save_dir)
model.save_pretrained(save_dir)